libxc: fix xc_translate_foreign_address()
authorCristian-Bogdan Sirb <csirb@bitdefender.com>
Wed, 5 Apr 2017 14:53:53 +0000 (17:53 +0300)
committerWei Liu <wei.liu2@citrix.com>
Thu, 6 Apr 2017 09:37:24 +0000 (10:37 +0100)
commitef78bf31077aae1f60b97ac57b36bc66a17b12dd
tree3a6eeffba27be15f18caad5d4baa63d4c9d4fd54
parent0beeb56bc943c04cd7ff9233ce307455a726532d
libxc: fix xc_translate_foreign_address()

Currently xc_translate_foreign_address() only checks for the PSE bit on
level 2 entries (that's 2 MB pages on x64 and 32-bit with PAE, and 4 MB
pages on 32-bit). But the Linux kernel sometimes uses 1 GB pages. This
patch fixes that, by checking the PSE bit on level 3 entries if the guest
has 4 translation levels (that means 64-bit guests only).

Signed-off-by: Cristian-Bogdan Sirb <csirb@bitdefender.com>
Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
tools/libxc/include/xenctrl.h
tools/libxc/xc_pagetab.c